export async function compress(picturePath) {
    const originSize = await wx
        .getFileInfo({
            filePath: picturePath,
        })
        .then((res) => res.size);

    let quality = 80;
    if (originSize < 700000) return picturePath;
    if (originSize > 1000000) {
        quality = Math.floor((1000000 * 100) / originSize);
        console.log("压缩率", quality);
    }
    return wx
        .compressImage({
            src: picturePath, // 图片路径
            quality, // 压缩质量
        })
        .then((res) => {
            return res.tempFilePath;
        });
}
